Symmetrical codec selection in an asymmetrical codec environment

ABSTRACT

A codec selector, and a corresponding method for establishing media channels between a local endpoint and a remote endpoint, are disclosed. The codec selector and method are useful with a media endpoint that is constrained to have matching transmit and receive codecs. The method comprises sending a request to a remote endpoint to open a first transmit channel. Upon receiving a corresponding request from the remote endpoint for its transmit channel, the two requests are compared. If the two requests do not match, the first transmit channel is closed (whether or not it has been acknowledged by the peer). A second transmit channel, compatible with the remote endpoint&#39;s request, is then requested. A method for detecting that the remote endpoint is using a similar procedure, and a procedure for synchronizing when both endpoints are constrained, are also disclosed. 
     The present invention reduces call setup time in most instances, and provides reliable channel setup for constrained endpoints.

This application is a continuation of prior U.S. Ser. No. 09/315,860,filed May 20, 1999 now U.S. Pat. No. 6,633,582.

FIELD OF THE INVENTION

This invention pertains generally to packet-switched multimediacommunications, and more particularly to media bearer channel setup forendpoints requiring symmetrical codecs.

BACKGROUND OF THE INVENTION

H.323 is a standard promulgated by the International TelecommunicationsUnion (ITU) for multimedia communications over local-area networks(LANs) utilizing Internet Protocol (IP) or another packet-switchedmedium. The H.323 standard is attractive, for one, because it is aflexible standard appearing in a field dominated by proprietary designsthat offer little hope for interoperability between different vendor'sequipment. Thus, H.323 offers the hope of a world where differentvendor's equipment and different carrier's networks can and willcommunicate seamlessly. The H.323 standard is also attractive because itallows an administrator some measure of control over the amount ofvoice, video, and other multimedia traffic traversing a packet-switchednetwork that has no other quality-of-service guarantees.

An H.323 call requires that several connections be set up between thecalling endpoints. The first of these is a TCP/IP connection for thecommunication of basic call functionality. ITU-T recommendation H.225describes the call signaling functionality that is provided on thischannel (a variation on Q.931 signaling).

The second connection is a control channel that orchestrates multimediadata communications between the endpoints. This second connection set upbetween endpoints is also a TCP/IP connection (note that with H.323version 2, a single TCP/IP connection can in some cases be used for boththe first and second connections). ITU-T recommendation H.245 describesthe control protocol to be used on this channel. A number of differentservices may be provided over an H.245 call control channel, includingmaster/slave endpoint determination, audio/visual and data capabilitiesexchange, and the management of logical channels used to transportaudio/visual and data information.

In particular, the audio/visual and data capabilities exchange isintended to ensure that the only multimedia signals that are transmittedare those that can be received and understood by a receiving endpoint.To implement this, each endpoint transmits a capability set to theother, indicating what types and combinations of information streams itcan accept. For example, H.323 allows endpoints to implement one or moreaudio codecs, including ITU audio codec specifications G.711 (required),G.722, G.723.1, G.728, and G.729, some of these having multiplepossibilities for bit rate and other settings. An endpoint can, e.g.,identify G.711, G.722, and G.729 in its capability set, signaling itspeer endpoint that it may choose to open a logical channel for any oneof these three identified audio codecs, but not for any other.

Because each H.323 transmitting endpoint can open a logical channelcorresponding to any one of its peer's advertised capabilities, it ispossible that the endpoints will select different transmit capabilities.This results in the creation of asymmetrical logical channels, e.g., aG.711 audio channel in one direction and a G.729 audio channel inanother.

Many systems can simultaneously operate one codec for transmitting, andanother for receiving, thus allowing them to function with asymmetricallogical channels. But in some terminal configurations, it may beadvantageous or necessary to constrain an endpoint to only symmetricalcodec selection. If asymmetrical logical channels are set up with suchan endpoint, its user may hear incoherent audio or nothing at all.

SUMMARY OF THE INVENTION

The H.245 recommendation fails to provide a reliable solution to theasymmetrical channels/symmetrical endpoint problem. H.245's generalconflict resolution scheme, if applied to this problem, may result inlong setup delays, or in the worst case, no resolution of the problem atall.

Although an endpoint desiring to establish symmetry with its peer couldwait and see what codec its peer selects before making its selection,this may also result in unacceptable media setup delays. This approachwould also potentially hang a connection when both ends choose to waitfor the other to go first in opening a logical channel.

The present invention offers a reliable, low-delay solution formultimedia endpoints that desire or require symmetrical codec selection.This solution guarantees that an endpoint desiring symmetrical codecscan achieve this desire, whether it is master or slave, whether it'speer can recognize conflicts or not, whether it's peer also desiressymmetrical codecs, and without regard to the vendor implementing thepeer equipment. The solution is also low-delay, as it reacts proactivelyto conflicts, and without imposing fixed system delays.

In one aspect of the present invention, a method of establishing mediaconnections with a remote endpoint is disclosed. An endpoint thatdesires a symmetrical connection opens a first logical channel of a typeselected from its peer's capability set—a type that also matches a codecthat it desires to receive. It does this without waiting to see whichtype of codec its peer actually requests for the incoming channel. Ifthe peer requests a symmetrical channel, the two-way connection has beenestablished with minimum delay. If the peer requests an asymmetricalchannel, the endpoint closes its first logical channel and opens asecond, using a codec that matches the peer's.

The present invention also includes a procedure for detecting andrecovering from a situation where both endpoints close and open logicalchannels in an effort to match their peer's codec selection. Oneendpoint detects the condition and delays further channel open/closeefforts, preferably for one measured round trip time, to allow the otherend to establish the symmetrical channel.

In another aspect of the invention, a codec selector is disclosed. Thecodec selector comprises a codec conflict detector that detectsconflicts between locally-requested and remotely-requested codecs. Thecodec selector also comprises a codec synchronizer that responds to aconflict detected by the codec conflict detector by closing alocally-requested codec and requesting a different codec that does notconflict with the remotely-requested codec.

This codec selector may be embodied, e.g., in a media gateway or in amedia gateway controller. For example, it may be used to resolveconflicts in a media gateway that has a plurality of receive codecs anda plurality of transmit codecs, the gateway constrained such that somecombinations of a receive codec and a transmit codec cannot be used onthe same call.

BRIEF DESCRIPTION OF THE DRAWING

The invention may be best understood by reading the disclosure withreference to the drawing, wherein:

FIGS. 1 and 2 show possible message exchanges between twoH.323-compliant endpoints attempting to use the H.245 conflictresolution scheme to correct codec asymmetry;

FIGS. 3, 4, and 5 show possible message exchanges between twoH.323-compliant endpoints attempting to use a non-preferred approach tocorrect codec asymmetry;

FIG. 6 shows a possible message exchange between a symmetricalcodec-only master endpoint utilizing an embodiment of the invention, andan asymmetrical slave endpoint;

FIG. 7 shows a possible message exchange between a symmetricalcodec-only master endpoint utilizing the H.245 conflict resolutionscheme and a symmetrical codec-only slave endpoint utilizing anembodiment of the invention;

FIG. 8 shows a possible message exchange between an asymmetrical masterendpoint and a symmetrical codec-only slave endpoint utilizing anembodiment of the invention;

FIG. 9 shows a possible message exchange between two symmetricalcodec-only endpoints, both operating according to an embodiment of theinvention;

FIG. 10 contains a flowchart illustrating decision paths for anembodiment of the invention; and

FIG. 11 shows a call signaling handler according to an embodiment of theinvention.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

The preferred embodiments are described below as applied toH.323/H.245-compliant connections and channels. These embodiments areexemplary, as it will be recognized that the invention may be applied toother communication protocols that allow endpoints to select channeltypes from amongst a group of capabilities. Likewise, although the H.245terms “master” and “slave” are used frequently herein, it will berecognized that equivalent implementations may be obtained by reversingroles and/or using equivalent designations. For example, whereapplicable, one endpoint can be thought of as “leading” in atransaction, and the other as “following”.

Conflict resolution under several schemes not according to the inventionwill now be described, in order that the following description of thepreferred embodiments can be better appreciated. First, FIGS. 1 and 2show possible message exchanges between two H.323-compliant endpointsattempting to use the H.245 conflict resolution scheme to correct codecasymmetry. The H.245 conflict resolution scheme requires that oneendpoint be pre-designated as “master”, and the other as “slave”, priorto the conflict arising. If the master identifies a request from theslave that is “conflicting” with its own requests, it is required toreject that slave request immediately. The slave, on the other hand,must respond affirmatively to the master's request, even if it knows therequest to be conflicting with its own.

FIG. 1 shows one possible message exchange, between a master endpointthat desires symmetrical codecs and a slave endpoint that can not onlyhandle asymmetry, but that doesn't recognize the master's symmetryneeds. Each endpoint first transmits a capability set to the otherduring capabilities exchange. In this example, both endpoints indicatethat they can support codecs “A”, “B”, and “C”. After master/slavedesignation (according to H.245's described method, or an equivalent),the master (endpoint 1) requests that a logical channel be opened usingcodec C. The slave (endpoint 2), before receiving the master's request,requests that a logical channel be opened using codec A.

When the master receives the slave's request, it knows that a conflicthas arisen, and it immediately sends a response to the slave, rejectingthe slave's request. The slave, on the other hand, is required to send aresponse acknowledging the master's request.

Sometime later, the slave is notified that its open logical channelrequest has been rejected. As it knows of no conflict, it may becomeconfused and try to open with codec A again. In this example, however,it moves on to the next codec in the list (B) instead. This codec isalso rejected. Moving on again, it tries C, and is this timeacknowledged. This exchange takes more than three round trip-times tocomplete, during which time the slave cannot transmit audio data to themaster.

FIG. 2 shows a reversed situation, where the slave endpoint desiressymmetrical codecs and the master endpoint can not only handleasymmetry, but doesn't recognize the slave's symmetry needs. Again, themaster endpoint issues an open logical channel request for codec C, andthe slave endpoint issues its request for codec A. When the master'srequest arrives at the slave, the slave may recognize the conflict, butis bound to acknowledge the master's request. The master, sensing noconflict, acknowledges the slave's request. The slave is left in aninoperable state.

In order to ensure that it knows its peer's codec selection beforemaking its own selection, a symmetrical codec-only endpoint could bedesigned to wait before attempting to open a logical channel. Forinstance, a scheme could be devised where when such an endpoint is mademaster, it would wait for a fixed delay, longer than the longestexpected delay for receiving an open-channel request from its peer,before issuing its own open channel request. When the endpoint is madeslave, it would likewise wait, e.g., for twice this first fixed delay.

FIG. 3 illustrates a message exchange under a first scenario using thisdelay scheme. The symmetrical master initially waits for a delay DM,looking for the open logical channel request from the slave. When itreceives this request, it mirrors the slave's codec in its own request.In this best-case scenario, approximately 1.5 round trip times arerequired to establish the logical channels.

In the message exchange of FIG. 4, this symmetrical master is pairedwith a symmetrical slave. The slave initiates a delay DS (approximatelytwice DM), and the master initiates its delay DM. At the expiration ofDM, the master has received no open channel request, so it assumes thatthe slave is symmetrical and sends an open channel request. The slave,still waiting, receives this request some time later, and mirrors it.Unfortunately, since DM and DS need to reflect worse-case delays, thedelay observed by the users in this case may be considerable.

This particular scheme also can result in malfunction if for some reason(i.e., an underlying transport layer loses and then has to resend amessage) a request is not received within the expected time frame. FIG.5 illustrates such a case. An asymmetrical slave sends a request to awaiting symmetrical master, but the request is delayed past theexpiration of DM. The master issues a request for a different codec, andrejects the slave's request. The slave must then try to guess themaster's intentions, much as the slave had to in the example of FIG. 1.

The present invention complies with the conflict resolution requirementsof H.245, but takes a distinctly different, and proactive, approach toresolving symmetry conflicts. FIG. 6 illustrates the simplest conflictscenario handled by the invention, one with a symmetrical master and anasymmetrical slave. Like in the non-preferred examples of FIGS. 1 and 2,the master in this example requests a logical channel for codec C, andthe slave effectively simultaneously requests a logical channel forcodec A. The slave acknowledges the master's request, as it is bound toby protocol, although it senses no conflict. The master, however, uponreceiving the slave's request, senses the potential conflict. Butinstead of rejecting the slave's request according to the general H.245conflict resolution scheme, the master instead acknowledges the slave'srequest and revokes its own request by issuing a close logical channelrequest, thereby averting the conflict. It then mirrors the slave'srequest in a new open logical channel request.

By the time the master receives the slave's acknowledgment of themaster's first request, its second request should be well on its way tothe slave. Thus the conflict has been resolved in only half a trip timemore than the no-conflict set up time. Note also that whereas the“delay” scheme of FIG. 3 slowed channel establishment whether a conflictwas likely to occur or not, no extra delay is incurred by thisembodiment of the invention if there is no potential conflict.

In the example of FIG. 7, the symmetrical endpoint operating accordingto an embodiment of the invention is the slave, and it is paired withanother symmetrical endpoint—this one, however, implements only basicH.245 conflict resolution. Upon receiving the master's open channelrequest, the slave foresees the upcoming conflict. Instead of waitingfor the forthcoming rejection of its own request, the slave issues aclose logical channel request, followed immediately by a new openchannel request that mirrors the master's request. The master issues itsrejection as expected, but receives a conforming request only half around trip time later.

FIG. 8 shows a similar scenario, but with the master endpoint allowingasymmetrical operation. Although in this example the masteracknowledges, instead of rejects, the slave's first open channelrequest, this is immaterial to the slave. By the time the slave receivesthe master's response, it has already identified the conflict and closedthe first channel, whether the channel is allowable or not. Therefore,it can be appreciated that this embodiment works efficiently withoutregard to the desires and operational particulars of the endpoint thatit is peered with. It can also be appreciated from the examples of FIGS.6, 7, and 8 that an embodiment of the invention would also operate whenpaired with an endpoint implementing the delay scheme described inconjunction with FIGS. 3, 4, and 5.

Indeed, the biggest challenge for a device utilizing the embodiments asdescribed thus far is in communicating with an identical device. Thisscenario is played out in the message exchange of FIG. 9. Althoughnon-standard messages could also be used to handle such a situation, thepreferred embodiment avoids the use of proprietary signaling.

Referring to FIG. 9, both master and slave desire symmetrical codecs,but choose different initial codecs. As both are operating according tothe invention, when they receive the other's request they each see apotential conflict, and close their initial codec to avoid it. Themaster then requests the slave's codec, and the slave requests themaster's. Unless this process is somehow halted, the two requests may“Ping-Pong” between the two endpoints indefinitely.

Preferably, an endpoint operating according to the invention operates todetect an impending Ping-Pong problem and avoid it. This generallyrequires that one endpoint stop closing and opening channels, so thatthe other can synchronize to it. In the embodiment of FIG. 9, the slaveimplements the Ping-Pong detection process.

The slave preferably checks for Ping-Pong conditions when it receives arequest to open from its peer. In one embodiment, the condition isinferred if the slave has already re-opened once to avoid a mismatch,and yet a mismatch persists. In other embodiments, the slave can trackthe master's requests, the sequencing of master and slave requests,etc., to improve the accuracy of the inference. The master may likewisedetect a Ping-Pong condition, although preferably it does not alteroperation.

When the slave detects a Ping-Pong condition, it stops trying to matchthe incoming codec, and leaves its current codec open. It then waits fora period to see if the master can resolve the conflict. Preferably, thewaiting period used by the slave is approximately one H.245-measuredround trip time (RT) from the point that the Ping-Pong condition isdetected. This allows the master time to synchronize to the slave'scodec.

The flowchart of FIG. 10 summarizes the operation of one embodiment ofthe invention. In this embodiment, symmetrical codec setup logic isexecuted by an endpoint: 1) immediately after master/slave determinationand receipt of the peer's capabilities; and 2) each time a request toopen a logical channel is received from the peer. Note that some H.323calls may use more than one type of channel (e.g., video and monauralaudio)—each type would be considered separately for symmetrization.

After block 20 or upon receiving a request to open at block 22, theendpoint determines, at block 28, whether the peer has already selecteda transmit codec. If the peer has not, the endpoint branches to block24, selects a codec that both endpoints support, and sends the peer arequest to open this codec. If the peer has already selected a transmitcodec, the endpoint branches instead to decision block 30.

At decision block 30, the endpoint checks whether it has already openeda transmit channel. If it has not, it branches to block 26 and requestsa transmit channel using the peer's codec. If it has already opened atransmit channel, the endpoint branches to block 32.

At decision block 32, if the codecs match, the matching logic is doneand the codec can be started. But if both endpoints have opened and thecodecs do not match, the matching logic then branches to decision block34.

The purpose of decision blocks 34 and 36 is to implement Ping-Pongcondition detection. If the endpoint is slave and no previous channelclose/open retries have been attempted by the endpoint, the endpointinfers that no Ping-Pong condition exists, and branches to block 42. Ifthe slave endpoint has already attempted at least one retry, however,the endpoint branches to block 37 and checks the number of times that ithas tried to open the channel. If this number is greater than a presetmaximum M (e.g., six tries), no more retries are attempted (althoughthis step is optional, it ensures that the slave will not go onindefinitely in attempting to match). If the number of open channelrequests does not exceed M, the slave delays for one round-trip time atblock 38, and then checks, at decision block 40, whether the master hascorrected the codec asymmetry. If it has not, the slave tries again tocorrect the asymmetry.

The master bypasses this Ping-Pong logic. Instead, the master implementsa separate check (block 35) on the number of times that it has tried toopen a channel. If this number exceeds a preset maximum N (e.g., threetries), no more retries are attempted by the master. This step ensuresthat the master will not go on indefinitely in attempting to match, andallows the slave additional time to match up if the endpoints are havingdifficulty synchronizing. If the number of open channel requests doesnot exceed N, the master branches to block 42 and tries to correct theasymmetry.

Block 42 performs the actual matching function by closing the endpoint'scurrent codec, selecting the peer's codec, and sending a request to thepeer to open a logical channel with that codec.

Several modifications to the basic flow diagram may be made to handleother situations. The slave may increase its delay during successiveactivations of block 38, in an attempt to allow a slow master time tosynchronize. The logic of FIG. 10 (or similar logic) may also be usedwhen a master endpoint refuses a channel request.

FIG. 11 illustrates a logical channel codec selector 50 according to anembodiment of the invention. Codec selector 50 communicates with H.245protocol layer 60, which communicates in turn with a peer H.245 protocollayer local at the other endpoint. Codec selector 50 also indicates(directly or indirectly) to codec processor 70 when it is appropriate tobegin using a particular codec and logical channel.

Several of the H.245 protocol “entities” are shown in FIG. 11. TheMaster Slave Determination Signaling Entity (MSDSE), Logical ChannelSignaling Entity (LCSE), and Capability Exchange Signaling Entity (CESE)are each designated in the H.245 protocol. Each of these entities eitherprovides to and/or accepts from codec selector 50, primitives useful inthe present invention.

Codec conflict detector 62 receives several types of messages from theLCSE. Conflict detector 62 receives an ESTABLISH.indication when thepeer wishes to open an incoming channel (the sending of anESTABLISH.response back to the peer will generally be handled by otherlogic not shown in FIG. 11). It also receives a RELEASE.indication whenthe peer closes an incoming channel. Further, for outgoing channels,conflict detector 62 receives ESTABLISH.confirm or RELEASE.indicationmessages from the peer, depending on whether an outgoing open channelrequest was acknowledged or rejected. Codec conflict detector 62 shouldalso have knowledge of the ESTABLISH.request messages issued by codecsynchronizer 66.

Upon receipt of an ESTABLISH.indication (and also, preferably, uponreceipt of a TRANSFER.indication from the CESE), codec conflict detector62 performs a codec check. Based on knowledge of each endpoint's currentlogical channel status (as seen from this end), codec conflict detector62 asserts one of two signals. If the endpoints appear to have matchedcodecs, the indication signal “No” is asserted to indicate that noconflict exists. This signal indicates to codec processor 70 that it maybegin processing media streams as the logical channels come up. Thissignal also resets delay unit 68. But if the endpoints have not matchedcodecs, conflict detector 62 asserts the “Yes” signal to Ping-Pongdetector 64.

Ping-Pong detector 64 decides whether the endpoint should wait for thepeer to resolve a conflict, or initiate an immediate resolution fromthis end. Ping-Pong detector 64 tracks some combination of channelopen/close statistics, as described in conjunction with FIG. 10.Ping-Pong detector 64 also receives DETERMINE.confirm messages from theMSDSE, such that it knows whether its endpoint is Master or Slave. Basedon statistics and Master/Slave status, Ping-Pong detector 64 decideswhether to assert a Start signal to delay unit 68 or a Resynch signal tocodec synchronizer 66.

When delay unit 68 detects that the Start signal has been asserted, itstarts a timer with an expiration time of RT (supplied by delaymeasurement unit 74). If this timer expires without delay unit 68 beingreset by codec conflict detector 62, delay unit 68 will assert theResynch signal to codec synchronizer 66.

Codec synchronizer 66 is responsible for the origination ofESTABLISH.request and RELEASE.request messages for the outgoing logicalchannel. In addition to tracking its current requests, codecsynchronizer 66 should also be aware of the peer's logical channelrequests. Further, codec synchronizer 66 needs to know the capabilityset 72 that has been advertised to the peer, and the peer's capabilityset received from the CESE.

Delay measurement unit 74 estimates the round trip delay RT for theconnection. Preferably, unit 74 notes the time of outgoing open channelrequests, notes the time of corresponding confirm or reject indications,and infers from the time difference the round trip delay for openchannel signaling. Although RT could also be estimated by issuing aTRANSFER.request to H.245 protocol layer 60's Round Trip Delay SignalingEntity (not shown), this is not preferred. Such a request measures roundtrip time to the H.245 peer, but would not include the additional delayincurred while the other endpoint responds to open and/or close channelrequests. This difference may be appreciable if H.245 signaling isadministered by a call agent that is physically separated from thelogical channel endpoint.

Logical channel codec selector 50 may be implemented in special-purposehardware, software running on a programmable processor, orimplementations falling between these two extremes. It may run on acommon processor with H.245 protocol layer 60, or on a common processorwith codec 70, or all three may share a processor, such as in a personalcomputer. These functions may occupy two or more processors on a commonendpoint platform, such as a media gateway. This need not be the case,however, and one or more of selector 50, layer 60, and codec processor70 may even reside on a separate platform from the others. For instance,selector 50 and layer 60 may reside on a call agent (e.g., a mediagateway controller) that handles call signaling for a large number ofmedia endpoints. Codec processor 70 may reside on one of the controlledmedia endpoints. Although the blocks of selector 50 are shown directlycommunicating with H.245 layer 60, an intermediate layer or layers mayreside between them in a given implementation. Other configurations willbe apparent to those skilled in the art upon reading this disclosure.

Although the codec constraints discussed in the examples were “samecodec” constraints, the present invention may be applied to otherconstraints, such as a limited asymmetry constraint where one-wayhigh-computational complexity and one-way low-computational complexitycodecs may be run together. The present invention can also be readilyadapted to other protocol communication sequences, such as a “faststart” approach where logical channels are proposed prior to orsimultaneously with capabilities exchange.

1. A method of establishing media channels between a localpacket-switched media endpoint and a remote packet-switched endpoint,the method comprising: receiving a remote capability set from the remoteendpoint; selecting a local media format appearing in both the remotecapability set and a local capability set; requesting a first transmitchannel, in the local media format, with the remote endpoint; detectinga remote media format of a remote transmit channel opened by the remoteendpoint; detecting potential conflicts between the first transmitchannel local media format and the remote transmit channel remote mediaformat; and when a potential conflict is detected, closing the firsttransmit channel and requesting a second transmit channel in a mediaformat that does not conflict with the remote transmit channel remotemedia format.
 2. The method of claim 1, wherein the recited method isperformed at the local endpoint.
 3. The method of claim 1, wherein atleast one of the recited method elements is performed by a call agent.4. The method of claim 1, further comprising: detecting, subsequent tothe requesting a second transmit channel, that the remote endpoint haschanged the remote transmit channel from the original remote mediaformat to a current remote media format; and closing the second transmitchannel and opening a third transmit channel using the current remotemedia format.
 5. The method of claim 1, further comprising: detecting,subsequent to the requesting a second transmit channel, that the remoteendpoint has changed the remote transmit channel from the originalremote media format to a current remote media format; delaying for awaiting period to see if the remote endpoint changes the remote transmitchannel back to the original remote media format; and when, after thewaiting period, the remote endpoint has not changed the remote transmitchannel back to the original remote media format, closing the secondtransmit channel and opening a third transmit channel using the currentremote media format.
 6. The method of claim 5, wherein the performing ofthe delaying for the waiting period depends on whether the localendpoint is designated as master or slave.
 7. The method of claim 6,wherein the delaying for the waiting period is performed when the localendpoint is slave.
 8. A codec selector comprising: means for initiatinga request for a locally-requested codec, from a set of codecs supportedby a remote peer, prior to the codec selector receiving a request fromthe remote peer for a remotely-requested codec; means for detectingconflicts between locally-requested and remotely-requested codecs; andmeans for synchronizing a locally-requested codec with aremotely-requested codec in response to the means for detectingconflicts, the means for synchronizing operating to close a currentlocally-requested codec and request a different codec that does notconflict with the remotely-requested codec.
 9. The codec selector ofclaim 8, embodied in a media gateway.
 10. The codec selector of claim 8,embodied in a media gateway controller.
 11. A codec selector comprising:means for detecting conflicts between locally-requested andremotely-requested codecs; means for synchronizing a locally-requestedcodec with a remotely-requested codec in response to a detected conflictdetected by the means for detecting conflicts, the means forsynchronizing operating to close an existing locally-requested codec andrequest a different codec that does not conflict with theremotely-requested codec; and ping-pong detecting means, at a localendpoint, for detecting that a remote endpoint is operating a codecsynchronizer.
 12. The codec selector of claim 11, wherein the ping-pongdetecting means counts responses to conflicts by the means forsynchronizing.
 13. The codec selector of claim 11, further comprisingdelay means, responsive to the ping-pong detecting means, for delayingthe response to the conflict by the means for synchronizing, wherein theremote endpoint is allowed time to synchronize codecs with the localendpoint.
 14. The codec selector of claim 13, wherein the delay meanscomprises a timer.
 15. The codec selector of claim 14, furthercomprising a delay estimator, the delay estimator supplying the timerwith an estimate of round-trip delay between dispatch of a request tothe remote endpoint and receipt of a corresponding response from theremote endpoint.
 16. The codec selector of claim 15, wherein the timerbases a timeout period on the estimate from the delay estimator.
 17. Thecodec selector of claim 13, wherein the means for detecting conflictssignals the delay means to reset when the remote endpoint achieves codecsynchronization.
 18. The codec selector of claim 11, embodied in a mediagateway.
 19. The codec selector of claim 11, embodied in a media gatewaycontroller.
 20. A media gateway comprising: a plurality of receivecodecs and a plurality of transmit codecs; a codec synchronizer thatinitiates a request for a first transmit codec, from a set of codecssupported by a remote endpoint, prior to the media gateway receiving arequest from the remote endpoint for a receive codec; and a codecconflict detector enabled to indicate, after receiving a request fromthe remote endpoint for a receive codec, that a second transmit codec isa better match for the receive codec than the first transmit codec; thecodec synchronizer responding to an indication from the codec conflictdetector by closing the requested transmit codec and requesting thesecond transmit codec.
 21. The media gateway of claim 20, furthercomprising a ping-gong detector to detect when the remote endpoint isalso operating a codec synchronizer.
 22. The media gateway of claim 21,wherein the ping-pong detector count responses to conflicts by the codecsynchronizer.
 23. The media gateway of claim 21, further comprising adelay unit, responsive to the ping-pong detector, to delay a response toa conflict by the codec synchronizer, thereby allowing time for theremote endpoint to synchronize codecs with a local endpoint.
 24. Themedia gateway of claim 23, wherein the delay unit comprises a timer. 25.The media gateway of claim 24, further comprising a delay estimator, thedelay estimator supplying the timer with an estimate of the round-tripdelay between the dispatch of a request to the remote endpoint and thereceipt of a corresponding response from the remote endpoint.
 26. Acomputer-readable media containing computer instructions that, whenexecuted by a processor, cause the processor to perform a method ofestablishing media channels between a local packet-switched endpoint anda remote packet-switched endpoint, the method comprising: receiving aremote capability set from the remote endpoint; selecting a local mediaformat appearing in both the remote capability set and a localcapability set; requesting a first transmit channel, in the local mediaformat, with the remote endpoint; detecting a remote media format of aremote transmit channel opened by the remote endpoint; detectingpotential conflicts between the first transmit channel local mediaformat and the remote transmit channel remote media format; and when apotential conflict is detected, closing the first transmit channel andrequesting a second transmit channel in a media format that does notconflict with the remote transmit channel remote media format.
 27. Thecomputer-readable media of claim 26, wherein the recited method isperformed at the local endpoint.
 28. The computer-readable media ofclaim 26, wherein at least one of the recited method elements isperformed by a call agent.
 29. The computer-readable media of claim 26,wherein the method further comprises: detecting, subsequent to therequesting a second transmit channel, that the remote endpoint haschanged the remote transmit channel from the original remote mediaformat to a current remote media format; and closing the second transmitchannel and opening a third transmit channel using the current remotemedia format.
 30. The computer-readable media of claim 26, wherein themethod further comprises: detecting, subsequent to the requesting asecond transmit channel, that the remote endpoint has changed the remotetransmit channel from the original remote media format to a currentremote media format; delaying for a waiting period to see if the remoteendpoint changes the remote transmit channel back to the original remotemedia format; and when, after the waiting period, the remote endpointhas not changed the remote transmit channel back to the original remotemedia format, closing the second transmit channel and opening a thirdtransmit channel using the current remote media format.
 31. Thecomputer-readable media of claim 30, wherein the performing of thedelaying for the waiting period depends on whether the local endpoint isdesignated as master or slave.
 32. The computer-readable media of claim31, wherein the delaying for the waiting period is performed when thelocal endpoint is slave.